Skip to content

Conversation

@abbesBenayache
Copy link
Contributor

No description provided.

- Add bulk processing support to sendTelegram method
- Support ProcessBulkRequestResponse with tasks array
- Add prepareBulkRequest integration with dataprotector SDK
- Update types to support bulk orders and responses
- Add unit tests for bulk processing scenarios
- Add e2e test for bulk telegram sending
- Update IExecWeb3telegram to use dataprotector instance
- Fix IPFS config to use ipfsGatewayURL and ipfsNodeURL
- Handle union types (SendTelegramSingleResponse | ProcessBulkRequestResponse)
- Add tests for bulk operations with allowBulk access grants
- Change iexec from 8.20.0-feat-bulk-processing-62e7c5f to exact version
- Update package-lock.json with resolved dependencies
- Clean up nested dependencies structure
- Remove PrepareBulkRequestResponse import (no longer needed)
- Replace bulkRequest with grantedAccess array parameter
- Make protectedData optional (required only for single processing)
- Add maxProtectedDataPerTask parameter
- Update SendTelegramParams documentation
- Add bulkOnly optional parameter to filter contacts with bulk access
- Pass bulkOnly parameter to fetchDatasetOrderbook calls
- Support filtering orders by bulk access capability
- Default value is false (returns all contacts)
…equest

- Replace bulkRequest parameter with grantedAccess array
- Make protectedData optional (required only for single processing mode)
- Restructure logic: bulk processing vs single processing
- Call prepareBulkRequest before processBulkRequest when grantedAccess provided
- Move protectedData validation to single processing mode only
- Improve separation of concerns between bulk and single processing
- Replace bulkRequest with grantedAccess parameter
- Remove unused prepareBulkRequest call (now internal to sendTelegram)
- Add maxProtectedDataPerTask parameter
- Make protectedData optional in test call
- Update @iexec/dataprotector from 2.0.0-beta.20-feat to ^2.0.0-beta.21
- Update iexec from 8.20.0-feat to ^8.22.0
- Replace bulkOrders with bulkAccesses in prepareBulkRequest calls
- Add ProcessBulkRequestParams type argument to ProcessBulkRequestResponse
- Fix e2e test to handle expected error when bulk processing is not available on network
@abbesBenayache abbesBenayache force-pushed the feat/sdk-bulk-processing-support branch from b2f74b7 to 4f3512b Compare November 4, 2025 14:56
abbesBenayache and others added 7 commits November 5, 2025 17:18
- Updated createAndPublishAppOrders to resolve ENS names before creating app orders
- Fixes 'Invalid order signer, must be the resource owner' error in e2e tests
- Ensures app orders are created with the correct resolved address
- Updated sendTelegram to properly handle protocol errors by checking isProtocolError flag before creating new WorkflowError
- Fixed test to use Web3TelegramWorkflowError instead of WorkflowError from @iexec/dataprotector
- Ensures protocol errors are properly detected and re-thrown with isProtocolError flag set
Comment on lines +72 to +74
const isProcessProtectedDataError =
error instanceof Error &&
error.message === 'Failed to process protected data';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not rely on the error message

import { WorkflowError as DPWorkflowError } from '@iexec/dataprotector"

// ...
    const isProcessProtectedDataError =
      error instanceof DPWorkflowError;

Comment on lines +56 to +58
if ((error as any)?.isProtocolError === true) {
throw error;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this code? I can't figure out when this happens.

Comment on lines +389 to +427
it('should re-throw protocol errors without modification', async () => {
// --- GIVEN
const mockCampaignRequest: BulkRequest = {
app: '0x0000000000000000000000000000000000000000',
appmaxprice: '1000',
workerpool: '0x0000000000000000000000000000000000000000',
workerpoolmaxprice: '1000',
dataset: '0x0000000000000000000000000000000000000000',
datasetmaxprice: '0',
params: '{"bulk_cid":"QmV8mtkG5qjAYjMGGkm6AKdXoXSZxfi1Wqbem4uX4oi9QM"}',
requester: getRandomAddress().toLowerCase(),
beneficiary: getRandomAddress().toLowerCase(),
callback: '0x0000000000000000000000000000000000000000',
category: '0',
volume: '1',
tag: '0x0000000000000000000000000000000000000000000000000000000000000000',
trust: '0',
salt: '0x0000000000000000000000000000000000000000000000000000000000000000',
sign: '0x0000000000000000000000000000000000000000000000000000000000000000',
};

const protocolError = new Error('Protocol error');
(protocolError as any).isProtocolError = true;

const mockDataprotector = {
processBulkRequest: jest
.fn<() => Promise<any>>()
.mockRejectedValue(protocolError),
} as any;

// --- WHEN & THEN
await expect(
sendTelegramCampaign({
dataProtector: mockDataprotector,
workerpoolAddressOrEns: defaultConfig.prodWorkerpoolAddress,
campaignRequest: mockCampaignRequest,
})
).rejects.toBe(protocolError);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this test

@PierreJeanjacquot PierreJeanjacquot changed the title Feat/sdk bulk processing support feat: add bulk processing support Nov 6, 2025
@PierreJeanjacquot PierreJeanjacquot changed the title feat: add bulk processing support feat: add bulk Telegram campaigns Nov 6, 2025
Copy link
Member

@PierreJeanjacquot PierreJeanjacquot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most looks good, but I still have some concerns with error handling (see open comments); maybe not specific to this PR

@PierreJeanjacquot PierreJeanjacquot merged commit 1eabf93 into main Nov 10, 2025
5 checks passed
@PierreJeanjacquot PierreJeanjacquot deleted the feat/sdk-bulk-processing-support branch November 10, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants